/**********************************************
 * 	Noun.java								  *
 *  Course: CS3343							  *
 *  Version: 2.0     Release 1				  *
 *  Last Modified : 22 MAR 2013			      *
 **********************************************/
package checker;

public class Noun extends Word {

   
	public Noun (String sign){
		super(sign,"Noun");
	}
	public Noun(){
		super("[n]","Noun");
	}

	
	public  boolean isOfType(String word){
		//get all the words starting with the letter that is the same as the initial letter of the input word
		//the second argument is the type of words to be retrieved for comparison, in this case, nouns
		//the return value is an array containing all the relevant words
		String[] nouns = fileIO.getWordCategory(word, "noun");
		
		//simply compare each value in the array with the input word
		for(int i = 0; i < nouns.length; i++){
			if(nouns[i].equalsIgnoreCase(word))
				//returning true means this is a noun
				return true;
		}
		return false;
	}
	
	

}
